// ================================================================================
// 		File: PartyJoinThoughtReport.cs
// 		Desc: 
//  
// 		Called by:   
//               
// 		Auth: chenwenzhi（--）
// 		Date: 2015-12-28 23:59
// ================================================================================
// 		Change History
// ================================================================================
// 		Date:		Author:				Description:
// 		--------	--------			-------------------
//    
// ================================================================================
// 
// ================================================================================
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace ZHDJ.Data.Models.JoinParty
{
    /// <summary>
    /// 
    /// </summary>   
    public class PartyJoinThoughtReport : EntityBase
    {
        #region 属性
        /// <summary>
        /// StandID
        /// </summary>
        [StringLength(128)]
        public string StandID { get; set; }



        /// <summary>
        /// LoginID
        /// </summary>
        [StringLength(128)]
        public string LoginID { get; set; }

        /// <summary>
        /// Title
        /// </summary>
        [StringLength(128)]
        public string Title { get; set; }

        /// <summary>
        /// Content
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// CreateTime
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// ReportTime
        /// </summary>
        public DateTime? ReportTime { get; set; }

        #endregion

        #region 查询管理
        /// <summary>
        /// 获取GetDataGrid数据源
        /// </summary>
        /// <returns></returns>
        public static DataSet GetGridData(string StandID)
        {
            StringBuilder sbSql = new StringBuilder();
            sbSql.AppendFormat(@"SELECT data.ReportTime,data.StandID,data.ID,data.LoginID,data.Title,data.Content,m.UserName,b.BranchName,
                                    data.CreateTime from tblPartyJoinThoughtReport data
                                    left join tblPartyJoinLinkExample LE on data.StandID=LE.StandID
                                    left join tblPartyJoinApplycation m on(LE.AppllicationID=m.AppllicationID)
                                    left join tblPartyOrgBranch b on(m.BranchID=b.BranchID)
                                 where 1=1 and data.StandID = '{0}'", StandID);
            sbSql.Append(" order by data.ReportTime ");
            return MySqlHelper.ExecuteDataSet(sbSql.ToString());
        }
        #endregion
    }
}
